package com.corecloud.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.corecloud.entity.SysPermissionRoleEntity;
import com.corecloud.mapper.mysql.SysPermissionRoleMapper;
import com.corecloud.service.SysPermissionRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("sysPermissionRoleService")
public class SysPermissionRoleServiceImpl implements SysPermissionRoleService {

    @Autowired
    private SysPermissionRoleMapper sysPermissionRoleMapper;

    @Override
    public SysPermissionRoleEntity getByParas(QueryWrapper<SysPermissionRoleEntity> qw) {
        return sysPermissionRoleMapper.selectOne(qw);
    }

    @Override
    public List<SysPermissionRoleEntity> getListByParas(QueryWrapper<SysPermissionRoleEntity> qw) {
        return sysPermissionRoleMapper.selectList(qw);
    }

    @Override
    public Integer updateInfoByPid(Integer pid) {
        return sysPermissionRoleMapper.updateInfoByPid(pid);
    }

    @Override
    public Integer updateInfoByRid(Integer rid) {
        return sysPermissionRoleMapper.updateInfoByRid(rid);
    }

    @Override
    public Integer saveInfo(SysPermissionRoleEntity info) {
        return sysPermissionRoleMapper.insert(info);
    }

    @Override
    public Integer deleteInfo(QueryWrapper<SysPermissionRoleEntity> qw) {
        return sysPermissionRoleMapper.delete(qw);
    }

}